﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Home : System.Web.UI.Page
{
   /* DataTable data = new DataTable();
    static PagedDataSource p = new PagedDataSource();
    public static int intSTT;
    public static int trang_thu = 0;
    * */
    protected void Page_Load(object sender, EventArgs e)
    {

    }
   /* public void load_data()
    {

        string sql = "select top 20 id, name, price, image, description from categories order by UpdateDate DESC";
        p.DataSource = data.get(sql).Tables[0].DefaultView;
        p.PageSize = 5;
        p.CurrentPageIndex = trang_thu;
        p.AllowPaging = true;
        
        bt1.Enabled = true; bt2.Enabled = true; bt3.Enabled = true; bt4.Enabled = true;

        if (p.IsFirstPage == true)//neu la dau.
        {
            bt1.Enabled = false;//neu la trang dau thi hai nut mo di.
            bt2.Enabled = false;
            bt3.Enabled = true;//Hai nut sau sang len.
            bt4.Enabled = true;
        }

        if (p.IsLastPage == true)//neu la cuoi
        {
            bt1.Enabled = true;//nguoc lai
            bt2.Enabled = true;
            bt3.Enabled = false;
            bt4.Enabled = false;
        }

        txtTrang.Text = (trang_thu + 1) + " / " + p.PageCount;

        DataList2.DataSource = p;
        DataList2.DataBind();
    }
    * */
}